UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'y5xLA0WLCo46CrFsDarITeckz44Z2EgDdo++Y2JM5yo=' 
WHERE 
  key_id = '66ec4e851213a26400ddf1e9b42cca0398c40dbd9d7ac42bb4ad5f12349f47ce' 
  AND (
    token = 'y5xLA0WLCo46CrFsDarITeckz44Z2EgDdo++Y2JM5yo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00015