UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'q2WNW19DrIiUnvlzxMnqy0pHY/6F+YbCB0qSWW8COdk='
WHERE
key_id = '575ba1f018b8de3ec033b3a4b8fba7ee65234865a29d85df9a13382ce1ee4bab'
AND (
token = 'q2WNW19DrIiUnvlzxMnqy0pHY/6F+YbCB0qSWW8COdk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)