UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'eDXPTShYB7T2nWHDkboP4GbQZtherYJW9DaBowICL88='
WHERE
key_id = 'c5b5f46942fe30d64e49c45a19a3b76cae1dd6b3c2d13dc1bb72a32e3c7553f7'
AND (
token = 'eDXPTShYB7T2nWHDkboP4GbQZtherYJW9DaBowICL88='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)