UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kwuBhaKtZkHB67TZdDasAP4ng5kOvguUcS8QTtqETFA=' 
WHERE 
  key_id = '9aa2091a33174fa7e9cbb7640cdf9f1ae2ccf226383fc2dbc30fa5b0f68c5cb7' 
  AND (
    token = 'kwuBhaKtZkHB67TZdDasAP4ng5kOvguUcS8QTtqETFA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017