UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'pZpFUdQ3R8oPPswmjpV9yHhpoY1B1WTJes9EDeZcf18=' 
WHERE 
  key_id = '03cadba9dd8833935e11e38e79a41993d3bac46d9783a2720bb5d955b90a639c' 
  AND (
    token = 'pZpFUdQ3R8oPPswmjpV9yHhpoY1B1WTJes9EDeZcf18=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032