UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Jij2dCqyKrtRld/3ivYzP6l3dsE8X1utDNegR3eOPJs=' 
WHERE 
  key_id = '547943475c573a498701f196e933a5a21c565541cb7a2fa44c42281c51bf2068' 
  AND (
    token = 'Jij2dCqyKrtRld/3ivYzP6l3dsE8X1utDNegR3eOPJs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035