UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Roa7tUN8BIFTCsMF1KtuE0fxvcMZNdMp/XoeP7CxcPo='
WHERE
key_id = '81dbaa4c577d854df2e8a5fb988b390ba4e4f2ad28cb5297446a83997f228a03'
AND (
token = 'Roa7tUN8BIFTCsMF1KtuE0fxvcMZNdMp/XoeP7CxcPo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)