UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'R8TjeDktDNYr2FPyi9KVu53uKZ5yGTDfVwPuMNdWeaU='
WHERE
key_id = '63d35c1f9ec8f5e3b04e4cb9eb018b0d0d5d701ec6a37658d47e6f8aac7ebe8d'
AND (
token = 'R8TjeDktDNYr2FPyi9KVu53uKZ5yGTDfVwPuMNdWeaU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)