UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0FBNpOXF0f5r4/SnZ7FuUb8633hStHPNk7C4Q7sVFW8=' 
WHERE 
  key_id = '1894dfbc0cf469beeb93b258b4ee52dbb0e24c9d74c7a020fdeaece501ca3c03' 
  AND (
    token = '0FBNpOXF0f5r4/SnZ7FuUb8633hStHPNk7C4Q7sVFW8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00058