UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MATEf6tNYKH8OiD7uQyfD8jKSD0i9v3YsRNaUUxRpaI=' 
WHERE 
  key_id = '81794a47cf29d819a6619235922c0a41843c04b67d96966f29d175ac5501f0b4' 
  AND (
    token = 'MATEf6tNYKH8OiD7uQyfD8jKSD0i9v3YsRNaUUxRpaI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028