UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'CyfWFLo7iBPABn2HZU/K0xnXd1krnfWWlXshtcO16uw=' 
WHERE 
  key_id = 'ef75255c94cb03db4e9fe22eab45de24db25298b192c55d3d966c5dda8cf335f' 
  AND (
    token = 'CyfWFLo7iBPABn2HZU/K0xnXd1krnfWWlXshtcO16uw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025