UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'fpuoupHZQ7g3qxED8q9csGflOOx2ouBfiChKjiWsZ1w=' 
WHERE 
  key_id = '3ef8a806debe0f4e32d164ebc7888c72b73d19e092b6d21714d3f698f2e4e5a4' 
  AND (
    token = 'fpuoupHZQ7g3qxED8q9csGflOOx2ouBfiChKjiWsZ1w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031