UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RmGlSZHhtxhwWjgD9bT20U2eAG9zxHHO/RN8dXo26lg='
WHERE
key_id = '1241ac503e264c394aa121eb07c5b63b98fd50c59d5993fe0a2e716a7fd1723a'
AND (
token = 'RmGlSZHhtxhwWjgD9bT20U2eAG9zxHHO/RN8dXo26lg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)