UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'n+j3NbL74IfmOcl9jMImSM4SVQFmLuiWr7JEyPp3zng=' 
WHERE 
  key_id = 'e15533a638721655138b1dfe0d6b43f0883ffa1c7a5175c285fe02fe17a9b2c2' 
  AND (
    token = 'n+j3NbL74IfmOcl9jMImSM4SVQFmLuiWr7JEyPp3zng=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027