UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2+WCPmfOwumrpsiW564THFN/4sgZLJ2vCPXa5V4To2g=' 
WHERE 
  key_id = '99d5f27dbd8af9707578ca431691ff3ee784535521b6a59c6627391c1c4eaf89' 
  AND (
    token = '2+WCPmfOwumrpsiW564THFN/4sgZLJ2vCPXa5V4To2g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00080