UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '49uiqiWTeDMOFIVpHF9SBhtb8yOh1XHlDPKR/k/KgIM=' 
WHERE 
  key_id = 'a91cf6170e332af0f98f1d06649ee76e13b9b5f3184f9c083170ece70b224693' 
  AND (
    token = '49uiqiWTeDMOFIVpHF9SBhtb8yOh1XHlDPKR/k/KgIM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032