UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yxYxI/wcz35aUOdCfTZ9/oCJ+Ue+WzH8VYpe1WfVJjE=' 
WHERE 
  key_id = '5ef1c76896d62d85c39b6209a513159b7ccac04685feeb6e366517276d784d2d' 
  AND (
    token = 'yxYxI/wcz35aUOdCfTZ9/oCJ+Ue+WzH8VYpe1WfVJjE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028