UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'c7lNn+ZSAZPDCCy/UjIK5cMzS/smEi+WDT/4pBG7XvM=' 
WHERE 
  key_id = 'd1402d7c33a0bf339eb10378eb828f1ccff78583c229746ad516e9dd5609bad4' 
  AND (
    token = 'c7lNn+ZSAZPDCCy/UjIK5cMzS/smEi+WDT/4pBG7XvM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00053