UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hxY0+wvDTOUajZCM486WV2BJYLas+EBPuNEhzvi5yIY='
WHERE
key_id = '8a4a8a13c8248d51f349bb8137908a0a4085adbe70fe5e292eff12409a8aa962'
AND (
token = 'hxY0+wvDTOUajZCM486WV2BJYLas+EBPuNEhzvi5yIY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)