UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0J3bCZx9GeGz6LMC5+ga4gonf8nx8AdmCcncUlYCwMY='
WHERE
key_id = '79734d7fa6c1b4e9fe956523d61fc874f3b6ca297bd09fe97c516e9108ac1c69'
AND (
token = '0J3bCZx9GeGz6LMC5+ga4gonf8nx8AdmCcncUlYCwMY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)