UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kozkEZVmdw/w5nu6x6XPiSm8lOuM5lkJCyE4qGiFDpk='
WHERE
key_id = 'd00c234fa8a9f208362acb8b01f438c97190daf30c3f8aae78a79a394662a66f'
AND (
token = 'kozkEZVmdw/w5nu6x6XPiSm8lOuM5lkJCyE4qGiFDpk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)