UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'q6EEtucf28V7qOgmD3F8V9XInqc8PrW0BNO5BMsHCh0=' 
WHERE 
  key_id = 'd6d972efdae2718ec25058e146f11984080bf35784c6d1fc02fc096e208c910a' 
  AND (
    token = 'q6EEtucf28V7qOgmD3F8V9XInqc8PrW0BNO5BMsHCh0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018