UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Vhdf0V5ekObMQKY9eszKGfknpEugssBbcNWF3LoN/oI=' 
WHERE 
  key_id = '641ea141a276cecce6ea45d1344a5c3f23e35f7da6f6baad56bad2eb4bec4eef' 
  AND (
    token = 'Vhdf0V5ekObMQKY9eszKGfknpEugssBbcNWF3LoN/oI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039