UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'omjt+rFwcIatD2A4ZAaq3s16cDaRNbeCezaz19tC6po='
WHERE
key_id = 'ff3cccc7295545469379b5a72bc757d47e302fd30692402622f699123ac3218a'
AND (
token = 'omjt+rFwcIatD2A4ZAaq3s16cDaRNbeCezaz19tC6po='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)