UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'si2HnBZY7sXWVFWaLeJRZTcSyFcwkJMFPI55UROFxZA=' 
WHERE 
  key_id = '46aa407a791f82572f38e28283e28609c749cd43dadb1d6cfad1fea7ba1cb5b4' 
  AND (
    token = 'si2HnBZY7sXWVFWaLeJRZTcSyFcwkJMFPI55UROFxZA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028