UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lbpq3+pGXSa1SErncpqC/xAc52PwAqFkyeM+7A+gya4=' 
WHERE 
  key_id = '7ebac00aa62121e903dca80ecec1c0c7939866d4cbc6fd8780a02b0c661a41b6' 
  AND (
    token = 'lbpq3+pGXSa1SErncpqC/xAc52PwAqFkyeM+7A+gya4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031