UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CLDE8JnYyxL0MdmHpp2zz0mQiZptxaj3sx/rFg02enE='
WHERE
key_id = '34a999d0976b82599e77afed34b723a4fc6ee9bb72280e4d893cdc04da9724f0'
AND (
token = 'CLDE8JnYyxL0MdmHpp2zz0mQiZptxaj3sx/rFg02enE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)