UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0Hsn6aM38gHj9vf+ePjxfGYKCDLRV7z5stjbwkYhkNE='
WHERE
key_id = '3f2f1ae0d0c6e65958390dbe24aceee8f7b28278fdefcdd555132a89ca1918d2'
AND (
token = '0Hsn6aM38gHj9vf+ePjxfGYKCDLRV7z5stjbwkYhkNE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)