UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'obI4/Nyw4v0JPdMHV3FN8jNqJzZieT88dsbtOlnEZWs='
WHERE
key_id = '67102489ad7fabcf9e86979faafcb7886bd0a46d7dae472758dbd3806d88e4a7'
AND (
token = 'obI4/Nyw4v0JPdMHV3FN8jNqJzZieT88dsbtOlnEZWs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)