UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0V+h6UAmGAJBproOM1dKpquRbSISBgZRHEFWBL45/cg=' 
WHERE 
  key_id = '888dbc700561dcf95cc153baa4686bbdf62f2fe3aa3d9884b2ac8556b4a3f539' 
  AND (
    token = '0V+h6UAmGAJBproOM1dKpquRbSISBgZRHEFWBL45/cg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041