UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yTjKXXHmecbaiRDF6Bfn2oVImyP8K4RHxA6rK9SL4YQ=' 
WHERE 
  key_id = '676507096d0dc1126bae29bba9d429ce74ee0249df467ce1978d19ad6c586405' 
  AND (
    token = 'yTjKXXHmecbaiRDF6Bfn2oVImyP8K4RHxA6rK9SL4YQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031