UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QJ+xGeLJ9+97Bcg8/Ad2ijj2Jd4UIH+fitiXRJAExvA='
WHERE
key_id = 'fda20fee9b0e86efbec5c46dea44f89c160b6b69a89679413ffde1bc688f05e4'
AND (
token = 'QJ+xGeLJ9+97Bcg8/Ad2ijj2Jd4UIH+fitiXRJAExvA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)