UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'scj4RlUcP9oh9SItN/Jt134dYK+6lQLnMQEBFKMQ+sM=' 
WHERE 
  key_id = 'e738331be959dc3a1d5372c368961fa84f35a23ded0ab40bcde91bbdfb2d055b' 
  AND (
    token = 'scj4RlUcP9oh9SItN/Jt134dYK+6lQLnMQEBFKMQ+sM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034