UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'RlO1/xIyOryCpd+MC2h94AFkZpiN06+DwZrwdBi0hek=' 
WHERE 
  key_id = '36ca441b7e884bbfef68f5790c24205bca8adf7c2d8f4d523cc2801a9d96d1b1' 
  AND (
    token = 'RlO1/xIyOryCpd+MC2h94AFkZpiN06+DwZrwdBi0hek=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032