UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FCLD9m7Bmh7Zm8sR546MsBQmw4I4h1rgy9QlVzCKESA=' 
WHERE 
  key_id = 'dd7556cda8ae037299bd8cf8a457fd7efde62d5d5b3b612a2b5a55f926a68034' 
  AND (
    token = 'FCLD9m7Bmh7Zm8sR546MsBQmw4I4h1rgy9QlVzCKESA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00056