UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'uP2GcRFUpY+ZIfF5Dq6KfnYmwKB1RfCnAXbLcFC5Y9U='
WHERE
key_id = '92a75c97175c8da8263f1d0e2ca67bbe1beba8c55fa0702ee13ee357009fc8bc'
AND (
token = 'uP2GcRFUpY+ZIfF5Dq6KfnYmwKB1RfCnAXbLcFC5Y9U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)